<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<LINK rel="Bookmark" href="/favicon.ico">
<LINK rel="Shortcut Icon" href="/favicon.ico" />

<link href="systemStyle/H-ui.css" rel="stylesheet" type="text/css" />
<link href="systemStyle/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="plugin/font/font-awesome.min.css" rel="stylesheet" type="text/css" />



<link rel="stylesheet" href="plugin/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="plugin/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="plugin/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="plugin/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="plugin/kindeditor/plugins/code/prettify.js"></script>

<title>依享科技企业网站管理后台</title>


</head>

<body>
	<nav class="Hui-breadcrumb"> <i class="icon-home">
	</i> 首页 <span class="c-gray en">&gt;</span> 
	内容管理 <span class="c-gray en">&gt;</span>
	新增文章
	<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="icon-refresh"></i></a></nav>
	<div class="pd-20">
	<form class="Huiform" method="post"		action="manage/articleManager_addArticle.do" target="_self"  enctype="multipart/form-data">
		<table class="table table-border table-bordered table-bg table-striped ">
			<tbody>
				<tr>
					<td>所属栏目： <select class="select" name="category">
						<c:forEach var="cate" items="${cates }">
								<option value="${cate.acId }">${cate.acName }</option>			
						</c:forEach>
					</select>
					</td>
					<td>是否设置为精品： <label><input type="radio"
							name="arType" value="1" checked="checked">是</label> <label><input
							type="radio" name="arType" value="0">否</label>
					</td>
				</tr>
				<tr>
					<td>文章缩略图：<span class="btn-upload"> <input
							class="input-text upload-url" type="text" name="uploadfile_1"
							id="uploadfile_1" readonly=""> <a style="z-index:2;"
							href="javascript:void();" class="btn btn-default radius">浏览</a> <input
							type="file" multiple="" name="file1" class="input-file">
					</span>
					</td>
					<td>
						<label>
							<input type="checkbox"  name="autoImg" value="1" >自动从文章中抓取图片
						</label><span class="c-999" >(如果文章中没有图片使用系统默认图片)</span> 
					</td>
				</tr>
				
				
				<tr>
					<td colspan="2">推荐到展柜： 
						<c:forEach var="box" items="${sbBoxs }">
							<label><input type="checkbox" name="sbBoxs" value="${box.sbId }">${box.sbName}</label>
						</c:forEach>	
					
					</td>
				</tr>
				<tr>
					<td colspan="2">
						文章标题： <input type="text" name="arTitle" style="width: 400px;" datatype="*1-50"
						class="input-text" ><span style="color: red;display: none">请输入文章标题</span>					
					</td>
				</tr>
				<tr>
					<td colspan="2">
						文章摘要： <input datatype="*1-250" name="arAbstract" style="width: 50%"	class="input-text" type="text" id="zy-input" ><input class='btn radius btn-primary' type="button" value="自动抓取" onclick="autoZy()"  >
						<input class='btn radius btn-primary' type="button" value="清空摘要" onclick="cleanZy()"  >
					</td>
				</tr>
				<tr>
					<td colspan="2">文章内容：<span class=" icon-arrow-down"></span></td>
				</tr>
				<tr>
					<td colspan="2">
							<textarea name="arContent" id="arContent" ></textarea>
				</tr>
				<tr>
					<td colspan="2"  class="text-c">
							<input type="submit"  class="btn radius btn-success "  value="发布"> 
							<input type="reset"  class=" btn radius btn-warning  ml-40"  value="重置"> 
				</tr>
			</tbody>
		</table>
		</form>
	</div>
	<jsp:include page="/systemPage/footerAdmin.jsp"></jsp:include>
	<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.9.1/jquery1.9.js"></script>
	<script type="text/javascript" src="systemJs/H-ui.js"></script>
	<script type="text/javascript" src="systemJs/H-ui.admin.js"></script>
	<script type="text/javascript" src="systemJs/Validform_v5.3.2_min.js"></script>
<script>
var editor1;
	KindEditor.ready(function(K) {
	editor1 = K.create('textarea[name="arContent"]', {
			cssPath : 'plugin/kindeditor/plugins/code/prettify.css',
			uploadJson : 'visitorPage/upload_json.jsp',
			fileManagerJson : 'visitorPage/file_manager_json.jsp',
			allowFileManager : true,
			width : '100%',
			height : '400px',
			afterCreate : function() {
				var self = this;
				K.ctrl(document, 13, function() {
					self.sync();
					document.forms['example'].submit();
				});
				K.ctrl(self.edit.doc, 13, function() {
					self.sync();
					document.forms['example'].submit();
				});
			}
		});
		prettyPrint();

	});
	function autoZy(){
		var text= editor1.text();
		$("#zy-input").val(text.substring(0,100));
	}
	
	function cleanZy(){
		$("#zy-input").val("");
	}
	
	
	$(".Huiform").Validform({
		tiptype : 3,
	});
	</script>
</body>

</html>
